#ifndef __TCP_LINK_H__
#define __TCP_LINK_H__

#include "socket_class.hpp"
#include "network.hpp"
#include "io.hpp"
#include "tlv.h"
#include <string>


using std::string;

namespace rocket 
{
    
class tcp_link
{
public:
    tcp_link(int) ;
    ~tcp_link() ;
    int receive(char *,int);
    int send(char *,int);
    int read_packet(packet &);
    int send_tlv(tlv );
private:
    sockaddr_in local_address();
    sockaddr_in peer_address();

private:
    socket_class _client_fd;
    network _local_address;
    network _peer_address;
    io _io;
};

}

#endif